package ee.logsimulator.data;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public enum SubType {
  DAMAGE(1),
  MISS(2),
  HEAL(3),
  AURA(4),
  DEATH(5),
  CAST(6),
  DISPEL(7),
  GAIN(8),
  ENCHANT(9),
  DURABILITY(10),
  SUMMON(11),
  OTHER(12);

  private static final Map<Integer, SubType> m;
  private int type;

  private SubType(int type) {
    this.type = type;
  }

  static {
    HashMap<Integer, SubType> map = new HashMap<Integer, SubType>();
    for (SubType t : values()) {
      map.put(t.getType(), t);
    }
    m = Collections.unmodifiableMap(map);
  }

  public int getType() {
    return type;
  }

  public static SubType fromType(Integer type) {
    return m.get(type);
  }
}
